// Using jQuery with Other Libraries
try {
jQuery.noConflict();

// Roodo extensions Options
var BloggerExtOptions = {
    core_version: '0.1.1'
};

var BloggerExt = {};
jQuery.extend( BloggerExt, {
        extensions: [],

        register: function(flag, opts) {
            BloggerExt.extensions.push(flag);
            if(opts) { jQuery.extend(BloggerExtOptions, opts); }
        },

        process: function() {
            jQuery(document).ready( function(){
                var flag;
                while( flag = BloggerExt.extensions.pop() ) {
                    if(BloggerExtOptions[flag]) { try { BloggerExt[flag](); }catch(e){} }
                }
            });
        },

        registerAndProcess: function(flag, opts) {
            BloggerExt.register(flag,opts);
            BloggerExt.process();
        }
});


BloggerExt.getSideObjByTitle = function(title) {
    var sideTitleAndContent = [];
    jQuery('.sideTitle, .sidetitle').each( function(i) {
            var objSideTitle = jQuery(this);
            var objSide = objSideTitle.next('.sideContent');
            if (objSide.length == 0) objSide = objSideTitle.parent().next('.sideContent'); // old web-tv
            if (objSide.length == 0) objSide = objSideTitle.parent().next().find('.sideContent'); // old web-tv
            if (objSide.length == 0) objSide = objSideTitle.next('.side'); // old roodo
            
            objSideTitle.contains(title).each( function(){ sideTitleAndContent.push(objSideTitle); sideTitleAndContent.push(objSide); } );
    });
    return sideTitleAndContent;
};


// Register hide_sidebar_html_markup
BloggerExt.hide_sidebar_html_markup = function() {

    var hiddenSides = BloggerExt.getSideObjByTitle('##HIDEME##');
    for(var i=0; i<hiddenSides.length; i+=2) {
        var objTitle = hiddenSides[i];
        var objSide = hiddenSides[i+1];
        if (objTitle != 'undefined') objTitle.hide();
        if (objSide != 'undefined') objSide.hide();
    }

};
BloggerExt.register('hide_sidebar_html_markup', { hide_sidebar_html_markup: true} );


// Run All Register Process
BloggerExt.process();
}catch (e) { }
